/*     */ package eos.moe.dragoncore;
/*     */ 
/*     */ import java.io.Serializable;
/*     */ import java.nio.FloatBuffer;
/*     */ import org.lwjgl.util.vector.ReadableVector3f;
/*     */ import org.lwjgl.util.vector.Vector;
/*     */ import org.lwjgl.util.vector.WritableVector3f;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ public class bax
/*     */   extends Vector
/*     */   implements Serializable, ReadableVector3f, WritableVector3f
/*     */ {
/*     */   private static final long serialVersionUID = -3627581338777397405L;
/*     */   public float x;
/*     */   public float y;
/*     */   public float z;
/*     */   
/*     */   public bax() {}
/*     */   
/*     */   public bax(ReadableVector3f readableVector3f) {
/*  24 */     set(readableVector3f);
/*     */   }
/*     */   
/*     */   public bax(float f1, float f2, float f3) {
/*  28 */     set(f1, f2, f3);
/*     */   }
/*     */   
/*     */   public void set(float f1, float f2) {
/*  32 */     this.x = f1;
/*  33 */     this.y = f2;
/*     */   }
/*     */   
/*     */   public void reverseY() {
/*  37 */     this.y = -this.y;
/*     */   }
/*     */   
/*     */   public void set(float f1, float f2, float f3) {
/*  41 */     this.x = f1;
/*  42 */     this.y = f2;
/*  43 */     this.z = f3;
/*     */   }
/*     */   
/*     */   public bax set(ReadableVector3f readableVector3f) {
/*  47 */     this.x = readableVector3f.getX();
/*  48 */     this.y = readableVector3f.getY();
/*  49 */     this.z = readableVector3f.getZ();
/*  50 */     return this;
/*     */   }
/*     */   
/*     */   public float lengthSquared() {
/*  54 */     return this.x * this.x + this.y * this.y + this.z * this.z;
/*     */   }
/*     */   
/*     */   public bax translate(float f1, float f2, float f3) {
/*  58 */     this.x += f1;
/*  59 */     this.y += f2;
/*  60 */     this.z += f3;
/*  61 */     return this;
/*     */   }
/*     */   
/*     */   public static bax add(bax a, bax bax1, bax bax2) {
/*  65 */     if (bax2 == null) {
/*  66 */       return new bax(a.x + bax1.x, a.y + bax1.y, a.z + bax1.z);
/*     */     }
/*  68 */     bax2.set(a.x + bax1.x, a.y + bax1.y, a.z + bax1.z);
/*  69 */     return bax2;
/*     */   }
/*     */ 
/*     */   
/*     */   public static bax sub(bax a, bax bax1, bax bax2) {
/*  74 */     if (bax2 == null) {
/*  75 */       return new bax(a.x - bax1.x, a.y - bax1.y, a.z - bax1.z);
/*     */     }
/*  77 */     bax2.set(a.x - bax1.x, a.y - bax1.y, a.z - bax1.z);
/*  78 */     return bax2;
/*     */   }
/*     */ 
/*     */   
/*     */   public static bax cross(bax a, bax bax1, bax bax2) {
/*  83 */     if (bax2 == null) {
/*  84 */       bax2 = new bax();
/*     */     }
/*     */     
/*  87 */     bax2.set(a.y * bax1.z - a.z * bax1.y, bax1.x * a.z - bax1.z * a.x, a.x * bax1.y - a.y * bax1.x);
/*  88 */     return bax2;
/*     */   }
/*     */   
/*     */   public Vector negate() {
/*  92 */     this.x = -this.x;
/*  93 */     this.y = -this.y;
/*  94 */     this.z = -this.z;
/*  95 */     return this;
/*     */   }
/*     */   
/*     */   public bax negate(bax bax1) {
/*  99 */     if (bax1 == null) {
/* 100 */       bax1 = new bax();
/*     */     }
/*     */     
/* 103 */     bax1.x = -this.x;
/* 104 */     bax1.y = -this.y;
/* 105 */     bax1.z = -this.z;
/* 106 */     return bax1;
/*     */   }
/*     */   
/*     */   public bax normalise(bax bax1) {
/* 110 */     float f = length();
/* 111 */     if (bax1 == null) {
/* 112 */       bax1 = new bax(this.x / f, this.y / f, this.z / f);
/*     */     } else {
/* 114 */       bax1.set(this.x / f, this.y / f, this.z / f);
/*     */     } 
/*     */     
/* 117 */     return bax1;
/*     */   }
/*     */   
/*     */   public static float dot(bax a, bax bax1) {
/* 121 */     return a.x * bax1.x + a.y * bax1.y + a.z * bax1.z;
/*     */   }
/*     */   
/*     */   public static float angle(bax a, bax bax1) {
/* 125 */     float f = dot(a, bax1) / a.length() * bax1.length();
/* 126 */     if (f < -1.0F) {
/* 127 */       f = -1.0F;
/* 128 */     } else if (f > 1.0F) {
/* 129 */       f = 1.0F;
/*     */     } 
/*     */     
/* 132 */     return (float)Math.acos(f);
/*     */   }
/*     */   
/*     */   public Vector load(FloatBuffer floatBuffer) {
/* 136 */     this.x = floatBuffer.get();
/* 137 */     this.y = floatBuffer.get();
/* 138 */     this.z = floatBuffer.get();
/* 139 */     return this;
/*     */   }
/*     */   
/*     */   public Vector scale(float f) {
/* 143 */     this.x *= f;
/* 144 */     this.y *= f;
/* 145 */     this.z *= f;
/* 146 */     return this;
/*     */   }
/*     */   
/*     */   public Vector store(FloatBuffer floatBuffer) {
/* 150 */     floatBuffer.put(this.x);
/* 151 */     floatBuffer.put(this.y);
/* 152 */     floatBuffer.put(this.z);
/* 153 */     return this;
/*     */   }
/*     */   
/*     */   public String toString() {
/* 157 */     StringBuilder stringBuilder = new StringBuilder(64);
/* 158 */     stringBuilder.append("Vector3f[");
/* 159 */     stringBuilder.append(this.x);
/* 160 */     stringBuilder.append(", ");
/* 161 */     stringBuilder.append(this.y);
/* 162 */     stringBuilder.append(", ");
/* 163 */     stringBuilder.append(this.z);
/* 164 */     stringBuilder.append(']');
/* 165 */     return stringBuilder.toString();
/*     */   }
/*     */   
/*     */   public float getX() {
/* 169 */     return this.x;
/*     */   }
/*     */   
/*     */   public float getY() {
/* 173 */     return this.y;
/*     */   }
/*     */   
/*     */   public void setX(float f) {
/* 177 */     this.x = f;
/*     */   }
/*     */   
/*     */   public void setY(float f) {
/* 181 */     this.y = f;
/*     */   }
/*     */   
/*     */   public void setZ(float f) {
/* 185 */     this.z = f;
/*     */   }
/*     */   
/*     */   public float getZ() {
/* 189 */     return this.z;
/*     */   }
/*     */   
/*     */   public boolean equals(Object object) {
/* 193 */     if (this == object)
/* 194 */       return true; 
/* 195 */     if (object == null)
/* 196 */       return false; 
/* 197 */     if (getClass() != object.getClass()) {
/* 198 */       return false;
/*     */     }
/* 200 */     bax bax1 = (bax)object;
/* 201 */     return (this.x == bax1.x && this.y == bax1.y && this.z == bax1.z);
/*     */   }
/*     */ }


/* Location:              D:\fanbian\[D][龙之核心]DragonCore-2.6.0.3.jar!\eos\moe\dragoncore\bax.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */